﻿using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Acme.BookStore2.Controllers
{
    [RemoteService(Name = "Default")]
    [Area("bookstore2")]
    [ControllerName("VehicleDriveRecord")]
    [Route("api/bookstore2/VehicleDriveRecords")]
    public class VehicleDriveRecordController : BookStore2Controller, IVehicleDriveRecordAppService
    {
        private readonly IVehicleDriveRecordAppService _vehicleDriveRecordAppService;

        public VehicleDriveRecordController(IVehicleDriveRecordAppService vehicleDriveRecordAppService)
        {
            this._vehicleDriveRecordAppService = vehicleDriveRecordAppService;
        }
        
        [HttpGet]
        [Route("{id}")]
        public Task<VehicleDriveRecordDto> GetAsync(Guid id)
        {
            return _vehicleDriveRecordAppService.GetAsync(id);
        }
        
        [HttpGet]
        public Task<PagedResultDto<VehicleDriveRecordDto>> GetPagedListAsync(GetVehicleDriveRecordsInput input)
        {
            return _vehicleDriveRecordAppService.GetPagedListAsync(input);
        }
        
        [HttpPost]
        public Task<VehicleDriveRecordDto> CreateAsync(VehicleDriveRecordCreateDto input)
        {
            return _vehicleDriveRecordAppService.CreateAsync(input);
        }

        [HttpPut]
        [Route("{id}")]
        public Task<VehicleDriveRecordDto> UpdateAsync(Guid id, VehicleDriveRecordUpdateDto input)
        {
            return _vehicleDriveRecordAppService.UpdateAsync(id, input);
        }

        [HttpDelete]
        [Route("{id}")]
        public Task DeleteAsync(Guid id)
        {
            return _vehicleDriveRecordAppService.DeleteAsync(id);
        }

        [HttpGet] 
        [Route("export")]
        public Task ExportAsync(GetVehicleDriveRecordsInput input)
        {
            return _vehicleDriveRecordAppService.ExportAsync(input);
        }
    }
}